package com.example.stock.service.impl;

import com.example.stock.entity.dao.HistoryDao;
import com.example.stock.entity.eo.HistoryEo;
import com.example.stock.service.IHistoryService;
import com.example.stock.vo.HistoryUpdateForm;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * </p>
 *
 * @author zcf
 * @since 2023/1/16
 */
@Service
public class HistoryServiceImpl implements IHistoryService {

    @Resource
    private HistoryDao historyDao;


    @Override
    public List<HistoryEo> list() {
        return historyDao.listByDesc();
    }

    @Override
    public void update(HistoryUpdateForm form) {
        HistoryEo update = new HistoryEo();
        update.setId(form.getId());
        update.setTrEarn(form.getTrEarn());
        historyDao.updateById(update);

    }
}
